<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //登录-会员联盟系统(沃尔玛、华润万家、盒马)
        let ajax1 = function () {
            return new Promise((resolve, reject) => {
                reject("沃尔玛")
            })
        }
        let ajax2 = function () {
            return new Promise((resolve, reject) => {
                reject("华润万家")
            })
        }
        let ajax3 = function () {
            return new Promise((resolve, reject) => {
                resolve("盒马")
            })
        }
        //只要有一个返回了fulfilled状态的promise对象，那就会进then(谁最快谁进)，没有就进catch
        Promise.any([ajax1(), ajax2(), ajax3()]).then(res => {
            console.log(res) //华润万家
        }).catch(err => {
            console.log("err", err)
        })
    </script>
</body>

</html>